var prefix = ctx + "admin/tenant";

$(function() {
    var options = {
        url: prefix + "/page",
        updateUrl: prefix + "/goEditTenant",
        removeUrl: prefix + "/{id}",
        sortName: "name",
        sortOrder: "asc",
        modalName: "租户",
        columns: [{
                title: "序号",
                formatter: function (value, row, index) {
             	    return $.table.serialNumber(index);
                }
            }, 
            {
    	    field: 'name',
    	    title: '租户名称',
    	    sortable: true,
    	    formatter: function (value, row, index) {
    	    	return '<a href="javascript:$.operate.view(' + "'" + row.id + "'" + ')">' + value + '</a>';
    	    },
    	},
    	{
    	    field: 'code',
    	    title: '租户编码',
    	    sortable: true
    	},
    	{
			field : 'status',
			title : '状态',
			align : 'center',
			formatter : function(value, row, index) {
				return $.table.selectDictLabel(status_datas, value);
			}
		}
    	,{
			field : 'startTime',
			title : '开始时间',
			sortable : true
		},{
			field : 'endTime',
			title : '结束时间',
			sortable : true
		},{
            title: '操作',
            formatter: function (value, row, index) {
                var actions = [];
                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                actions.push('<a class="btn btn-danger btn-xs ' + deleteFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                return actions.join('');
            }
        }]
    };
    $.table.init(options);
});